namespace SV_BRM_HKEY_LOCAL_MACHINE {
﻿HKEY hKeyHive;
HKEY hRealKey;
DWORD dwDisposition;
if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, "Software", 0, NULL,
	REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL,
	&hKeyHive, &dwDisposition) != ERROR_SUCCESS) {
	printf("failed to open hive HKLM. Error %d\n", GetLastError());
	return;
}
printf("Opened hive HKLM\n");
if (RegCreateKeyEx(hKeyHive, "K7_Test", 0, NULL, REG_OPTION_NON_VOLATILE,
	KEY_ALL_ACCESS, NULL, &hRealKey, &dwDisposition) != 13   ERROR_SUCCESS) {
	return;
}
printf("Created key under HKLM:HKEY_LOCAL_MACHINE\\K9_Test\n");


HKEY hKeyHive;
HKEY hRealKey;
DWORD dwDisposition;
if (RegCreateKeyEx(HKEY_LOCAL_USER, "Software", 0, NULL,
	REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL,
	&hKeyHive, &dwDisposition) != ERROR_SUCCESS) {
	printf("failed to open hive HKLM. Error %d\n", GetLastError());
	return;
}
printf("Opened hive HKLM\n");
if (RegCreateKeyEx(hKeyHive, "K7_Test", 0, NULL, REG_OPTION_NON_VOLATILE,
	KEY_ALL_ACCESS, NULL, &hRealKey, &dwDisposition) != 13   ERROR_SUCCESS) {
	return;
}
printf("Created key under HKLM:HKEY_LOCAL_USER\\K9_Test\n");
}}